var express = require('express');
var router = express.Router();
var db = require('../mysql/db')

router.post('/set', function (req, res, next) {
    const doctorSet = req.body
    console.log(doctorSet)
    // console.log(JSON.stringify(doctorSet.medicineList))
    let sql = `UPDATE register_info SET register_status = 1, symptom = "` + doctorSet.symptom + `",check_result = "` + doctorSet.check_result +  `", medicine = '` + JSON.stringify(doctorSet.medicineList) + `', checkProject = '` + JSON.stringify(doctorSet.checkProjectList) + `' WHERE register_id = ` + doctorSet.register_id;
    db.query(sql, [], results => {
        res.json({
            errno: 0, message: results
        })
        //console.log(results)
    })
});

module.exports = router;